program example_display_complex

    use display_module, only: display
    implicit none
    integer :: i

    call display((1.0, 2.0), '(1.0, 2.0):')
    call display((1.0, 2.0), '(1.0, 2.0):', inline=.true.) ! inline output only for scalar
    call display((1.0, 2.0), '(1.0, 2.0):', format='sp,f10.3', unit=6) ! default format is 'es10.3'
    call display([complex ::(i, i=1, 10)], '1:10:')
    call display([complex ::(i, i=1, 10)], header='1:10:', brief=.false.)
    call display(reshape([complex ::(i, i=1, 25)], [5, 5]), '5x5:')
    call display(reshape([complex ::(i, i=1, 36)], [6, 6]), '6x6:', .true.)
    call display(reshape([complex ::(i, i=1, -35, -1)], [6, 6]), '6x6:', .false.)

end program example_display_complex
! [scalar] (1.0, 2.0):
! ( 1.000E+00, 2.000E+00)
! [scalar] (1.0, 2.0): ( 1.000E+00, 2.000E+00)
! [scalar] (1.0, 2.0):
! (    +1.000,    +2.000)
! [vector: 10] 1:10:
! ( 1.000E+00, 0.000E+00), ( 2.000E+00, 0.000E+00), ( 3.000E+00, 0.000E+00), ... ( 1.000E+01, 0.000E+00)
! [vector: 10] 1:10:
! ( 1.000E+00, 0.000E+00), ( 2.000E+00, 0.000E+00), ( 3.000E+00, 0.000E+00), ( 4.000E+00, 0.000E+00), ( 5.000E+00, 0.000E+00), ( 6.000E+00, 0.000E+00), ( 7.000E+00, 0.000E+00), ( 8.000E+00, 0.000E+00), 
! ( 9.000E+00, 0.000E+00), ( 1.000E+01, 0.000E+00)
! [matrix: 5*5] 5x5:
! ( 1.000E+00, 0.000E+00), ( 6.000E+00, 0.000E+00), ( 1.100E+01, 0.000E+00), ( 1.600E+01, 0.000E+00), ( 2.100E+01, 0.000E+00);
! ( 2.000E+00, 0.000E+00), ( 7.000E+00, 0.000E+00), ( 1.200E+01, 0.000E+00), ( 1.700E+01, 0.000E+00), ( 2.200E+01, 0.000E+00);
! ( 3.000E+00, 0.000E+00), ( 8.000E+00, 0.000E+00), ( 1.300E+01, 0.000E+00), ( 1.800E+01, 0.000E+00), ( 2.300E+01, 0.000E+00);
! ( 4.000E+00, 0.000E+00), ( 9.000E+00, 0.000E+00), ( 1.400E+01, 0.000E+00), ( 1.900E+01, 0.000E+00), ( 2.400E+01, 0.000E+00);
! ( 5.000E+00, 0.000E+00), ( 1.000E+01, 0.000E+00), ( 1.500E+01, 0.000E+00), ( 2.000E+01, 0.000E+00), ( 2.500E+01, 0.000E+00)
! [matrix: 6*6] 6x6:
! ( 1.000E+00, 0.000E+00), ( 7.000E+00, 0.000E+00), ( 1.300E+01, 0.000E+00), ... ( 3.100E+01, 0.000E+00);
! ( 2.000E+00, 0.000E+00), ( 8.000E+00, 0.000E+00), ( 1.400E+01, 0.000E+00), ... ( 3.200E+01, 0.000E+00);
! ( 3.000E+00, 0.000E+00), ( 9.000E+00, 0.000E+00), ( 1.500E+01, 0.000E+00), ... ( 3.300E+01, 0.000E+00);
!  :
! ( 6.000E+00, 0.000E+00), ( 1.200E+01, 0.000E+00), ( 1.800E+01, 0.000E+00), ... ( 3.600E+01, 0.000E+00)
! [matrix: 6*6] 6x6:
! ( 1.000E+00, 0.000E+00), (-5.000E+00, 0.000E+00), (-1.100E+01, 0.000E+00), (-1.700E+01, 0.000E+00), (-2.300E+01, 0.000E+00), (-2.900E+01, 0.000E+00);
! ( 0.000E+00, 0.000E+00), (-6.000E+00, 0.000E+00), (-1.200E+01, 0.000E+00), (-1.800E+01, 0.000E+00), (-2.400E+01, 0.000E+00), (-3.000E+01, 0.000E+00);
! (-1.000E+00, 0.000E+00), (-7.000E+00, 0.000E+00), (-1.300E+01, 0.000E+00), (-1.900E+01, 0.000E+00), (-2.500E+01, 0.000E+00), (-3.100E+01, 0.000E+00);
! (-2.000E+00, 0.000E+00), (-8.000E+00, 0.000E+00), (-1.400E+01, 0.000E+00), (-2.000E+01, 0.000E+00), (-2.600E+01, 0.000E+00), (-3.200E+01, 0.000E+00);
! (-3.000E+00, 0.000E+00), (-9.000E+00, 0.000E+00), (-1.500E+01, 0.000E+00), (-2.100E+01, 0.000E+00), (-2.700E+01, 0.000E+00), (-3.300E+01, 0.000E+00);
! (-4.000E+00, 0.000E+00), (-1.000E+01, 0.000E+00), (-1.600E+01, 0.000E+00), (-2.200E+01, 0.000E+00), (-2.800E+01, 0.000E+00), (-3.400E+01, 0.000E+00)
